#!/bin/bash
set -e

source $(dirname $0)/version

cd $(dirname $0)/..

echo "Start building ISO image"

HARVESTER_INSTALLER_VERSION=master

git clone --branch ${HARVESTER_INSTALLER_VERSION} --single-branch --depth 1 https://github.com/harvester/harvester-installer.git ../harvester-installer

cd ../harvester-installer/scripts

./ci

cd ..
HARVESTER_DIR=../harvester

mkdir -p ${HARVESTER_DIR}/dist/artifacts
cp dist/artifacts/* ${HARVESTER_DIR}/dist/artifacts
cp -r dist/harvester-cluster-repo  ${HARVESTER_DIR}/dist

